name: Python Tests

on: [push, pull_request]

jobs:
  test:
    name: Python tests
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: '3.10'

      - name: Install Poetry
        run: |
          curl -sSL https://install.python-poetry.org | python3
          export PATH="$HOME/.local/bin:$PATH"
          poetry --version

      - name: Install dependencies
        run: |
          poetry install

      - name: Run tests
        run: |
          poetry run pytest ./tests